Skip to content

feat: add config example validation script and workflow - #2627

Open
patrick-stephens wants to merge 27 commits into
masterfrom
2459_auto_validate_config_examples
Open

feat: add config example validation script and workflow#2627
patrick-stephens wants to merge 27 commits into
masterfrom
2459_auto_validate_config_examples

Conversation

@patrick-stephens

@patrick-stephens patrick-stephens commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Resolves #2459 by providing a simple AWK based approach to validating configuration examples:

  • We extract config using AWK searching for the Gitbook specific tags
  • We use the container image to then --dry-run the configuration and report success/failure
  • We repeat this for every example in the same file as there may be multiple ones.

A local script is provided that can be run for any file in the repo or all of them:

find . -type f -iname "*.md" | while read -r file; do ./scripts/test-config.sh $file; done

A workflow is provided to run this for any files changed in a PR so if an update is made to documentation it should check it is valid.

There is a basic suppression approach by file as there are some valid reasons for this:

  • Windows-specific plugins will fail in the container image
  • Some plugins, e.g. exec are not part of the container image
  • Some examples show loading custom WASM, LUA, Golang, etc. which is not available or easy to do in CI

As part of these changes we also found failures in existing files that were resolved.
Some tweaks were also required, e.g. parser definition must be in a separate file for legacy TOML config so it was updated to be a comment for the examples (which would be rejected anyway otherwise).

There are options to use something more complex like markdown-tree or similar to build an AST from the Markdown file to then pull out the bits we need but this may not work with the specific Gitbook format anyway and requires a whole load of extra dependencies.

Currently there is an upstream failure with certain plugins triggering a segmentation fault for --dry-run: fluent/fluent-bit#12113

Summary by CodeRabbit

  • Documentation

    • Clarified configuration examples, tab labels, parser guidance, and required feature support.
    • Corrected outdated keys, syntax, terminology, and formatting across inputs, filters, processors, outputs, and routing.
    • Improved Docker, Kafka, Loki, S3, Dynatrace, and buffering setup guidance.
  • Validation

    • Added automated checks for configuration examples in Markdown documentation.
    • Added guidance and utilities for extracting and validating multiple configuration formats and examples.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added configuration extraction and dry-run validation scripts, integrated them into pull-request workflow checks, and corrected configuration examples across installation and pipeline documentation.

Changes

Configuration validation

Layer / File(s) Summary
Markdown configuration extraction
scripts/extract-config.sh, scripts/README.md
Extracts selected YAML or text code fences from titled Markdown tabs, supports counting, and reports malformed fences.
Configuration validation utility
scripts/test-config.sh, scripts/README.md
Validates extracted examples with a Fluent Bit container, supports suppression and configurable runtime settings, and reports failures.
Pull-request validation workflow
.github/workflows/pr-example-validation.yaml
Detects changed Markdown files and runs configuration validation for each changed file.
Configuration example corrections
installation/downloads/docker.md, pipeline/buffering.md, pipeline/filters/*, pipeline/inputs/*, pipeline/outputs/*, pipeline/parsers.md, pipeline/processors/*
Corrects configuration syntax, labels, quoting, parser guidance, output keys, and Avro documentation.
Routing and inline processing examples
pipeline/inputs/kafka.md, pipeline/router.md
Embeds Lua processing and updates routing inputs, outputs, credentials, and example labels.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant test-config.sh
  participant FluentBitContainer
  PullRequest->>GitHubActions: change Markdown files
  GitHubActions->>test-config.sh: validate each changed file
  test-config.sh->>FluentBitContainer: run configuration dry-run
  FluentBitContainer-->>test-config.sh: return validation status
  test-config.sh-->>GitHubActions: report failures or success
Loading

Possibly related PRs

Suggested reviewers: cosmo0920

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding configuration example validation tooling and a pull-request workflow.
Linked Issues check ✅ Passed The PR implements the core requirements from [#2459]: extract documentation examples, dry-run validate them, support multiple examples, and check changed Markdown files.
Out of Scope Changes check ✅ Passed The documentation corrections, validation scripts, README, and workflow are directly related to automated configuration example validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2459_auto_validate_config_examples

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md Outdated
Comment thread scripts/README.md Outdated
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md Outdated
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md
Comment thread scripts/README.md Outdated
@patrick-stephens
patrick-stephens force-pushed the 2459_auto_validate_config_examples branch from ba1f42c to 56630f1 Compare July 19, 2026 15:58
@eschabell eschabell self-assigned this Jul 31, 2026
@eschabell eschabell added the waiting-on-review Waiting on a review from mainteners label Jul 31, 2026

@eschabell eschabell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrick-stephens did some cleanup work but it now is good to go, thanks for this! Please merge this when you are ready?

@eschabell eschabell added 5.0.9 and removed waiting-on-review Waiting on a review from mainteners labels Jul 31, 2026
Comment thread scripts/README.md
@patrick-stephens
patrick-stephens marked this pull request as ready for review August 1, 2026 11:42
@patrick-stephens
patrick-stephens requested a review from a team as a code owner August 1, 2026 11:42
@patrick-stephens

Copy link
Copy Markdown
Contributor Author

Once merged we can see how things go and look to extend it in the future with checks for case, etc.
There may be a little iteration required initially to get CI green properly and any additional exclusions we want to add.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (3)
scripts/test-config.sh (2)

119-128: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid rerunning the container just to capture failure output.

On failure, the container is run twice: once with output discarded (Line 120) to check the exit status, and again (Line 125) purely to surface output on stderr. Capture combined output on the first run instead, so a failing validation doesn't double the container startup/dry-run cost.

♻️ Proposed fix
-        if ! $CONTAINER_RUNTIME run --rm -t -v "$OUTPUT_FILE":"$OUTPUT_FILE":ro "$VALIDATION_IMAGE" fluent-bit --dry-run --config="$OUTPUT_FILE" &>/dev/null; then
+        VALIDATION_OUTPUT=$($CONTAINER_RUNTIME run --rm -v "$OUTPUT_FILE":"$OUTPUT_FILE":ro "$VALIDATION_IMAGE" fluent-bit --dry-run --config="$OUTPUT_FILE" 2>&1) && VALIDATION_STATUS=0 || VALIDATION_STATUS=$?
+        if [ "$VALIDATION_STATUS" -ne 0 ]; then
             FAILED_VALIDATIONS+=("$LANGUAGE example $EXAMPLE_INDEX")
-            # Provide the configuration and failure output for debugging purposes on stderr
             echo "ERROR: Validation failed for $LANGUAGE example $EXAMPLE_INDEX in $FILE" >&2
             cat "$OUTPUT_FILE" >&2
-            $CONTAINER_RUNTIME run --rm -t -v "$OUTPUT_FILE":"$OUTPUT_FILE":ro "$VALIDATION_IMAGE" fluent-bit --dry-run --config="$OUTPUT_FILE" >&2 || true
+            echo "$VALIDATION_OUTPUT" >&2
         else
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/test-config.sh` around lines 119 - 128, Update the validation command
in the configuration-checking flow to capture its combined output during the
initial container run while preserving the exit status. In the failure branch,
print the captured output instead of invoking $CONTAINER_RUNTIME a second time;
keep the existing configuration and failure-context diagnostics unchanged.

73-81: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Image is pulled once per invocation, i.e., once per changed file per PR run.

The workflow invokes this script once per changed Markdown file (see pr-example-validation.yaml, Line 58-61). Each invocation independently pulls $VALIDATION_IMAGE (Line 78), adding a network round-trip per file even when the image is already present locally. For PRs touching several documentation files, this adds up.

Consider checking for a local image and only pulling when absent, or moving the pull into a one-time setup step.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/test-config.sh` around lines 73 - 81, Update the image setup around
CONTAINER_RUNTIME and VALIDATION_IMAGE so the script checks whether
VALIDATION_IMAGE is already available locally before pulling it. Invoke the
runtime’s image-inspection command, pull only when the image is absent, and
preserve the existing error message and exit behavior when a required pull
fails.
scripts/extract-config.sh (1)

146-171: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Silent success when the tab title is never found.

In the END block, the error branch only fires when found_tab && !found_fence (Line 166). If wanted_title never matches anywhere in the file, found_tab stays 0, so neither the success branch nor the error branch runs. The script exits 0 with empty output.

test-config.sh masks this because count mode already returns 0 and the caller skips extraction in that case. But scripts/README.md documents this script for direct standalone use ("can also be called directly"). A typo'd tab title passed directly would silently succeed with no output instead of reporting an error.

♻️ Proposed fix
         } else if (found_tab && !found_fence) {
             printf "ERROR: %s code fence #%d not found in tab: %s\n", wanted_language, target_index, wanted_title > "/dev/stderr"
             exit 1
+        } else if (!found_tab) {
+            printf "ERROR: tab not found: %s\n", wanted_title > "/dev/stderr"
+            exit 1
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/extract-config.sh` around lines 146 - 171, Update the extract-mode
validation in the END block so a missing tab title reports an error and exits
nonzero instead of silently succeeding. Extend the existing
found_tab/found_fence handling around wanted_title, while preserving count mode
and the current missing-fence and missing-code-fence errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-example-validation.yaml:
- Line 43: Update the changed_md grep filter in the workflow to use a literal
dot for the filename/path match, ensuring Markdown files at the repository root
and in subdirectories are detected while retaining the existing .md suffix
requirement.
- Line 43: Update the changed_md command in the PR validation workflow to use
git diff with the existing base and HEAD revision range, or first compute the
merge base before invoking git diff-tree. Preserve the current name and
diff-filter options so only added, modified, copied, or renamed Markdown files
are selected.
- Around line 42-46: Update the output-writing logic in the Markdown
change-detection step so the newline-separated value from changed_md uses GitHub
Actions’ multiline output delimiter syntax instead of echoing it as a plain
list= entry. Preserve the existing output name list and ensure the
delimiter-wrapped value is written safely to GITHUB_OUTPUT for multiple Markdown
files.

In `@pipeline/filters/parser.md`:
- Line 30: Update scripts/test-config.sh to discover each per-file tab title and
pass that title to extract-config.sh, rather than counting only
fluent-bit.yaml/fluent-bit.conf; ensure every renamed example is validated.
Apply this discovery behavior to the tab declarations at
pipeline/filters/parser.md:30-30 and :40-40, and
pipeline/outputs/kafka.md:110-110 and :157-157, using each declaration’s title
as the corresponding configuration name.

In `@pipeline/inputs/kafka.md`:
- Around line 145-156: Update the introductory paragraph to state that each
message is processed by the inline modify_kafka_message function rather than
kafka.lua, and revise the sentence structure so it clearly describes sending the
result back to the fb-sink topic on the same broker.

In `@pipeline/parsers.md`:
- Around line 68-72: Make both standalone YAML examples self-contained: in
pipeline/parsers.md, define custom_parser1 inline or reference a concrete
parser-file fixture before it is used; in pipeline/filters/kubernetes.md,
replace the legacy undefined parsers_file reference with the existing inline
custom-tag definition or another concrete parser-file fixture. Ensure each
extracted YAML tab validates independently.

In `@pipeline/router.md`:
- Line 210: Update the routing.yaml tab title in the routing documentation
around the routing.yaml example so scripts/test-config.sh recognizes and
extracts the routes configuration snippet. Use a supported extractor tab title
while preserving the existing routes syntax example.

In `@scripts/test-config.sh`:
- Around line 56-71: In the suppressed-file loop, replace the three redundant
conditions with one path-anchored match that accepts only an exact path or a
file beneath the suppressed entry as a directory. Preserve the informational
message and exit behavior, while ensuring names embedded in unrelated filenames
or extensions do not suppress validation.
- Around line 96-102: Update the Stage 1 counting flow around extract-config.sh
so genuine command failures remain visible and cause the validation to fail,
rather than being converted into EXAMPLE_COUNT=0. Preserve the legitimate
zero-example path that continues without validation, but capture and report the
extraction error separately using the existing script error-handling
conventions.

---

Nitpick comments:
In `@scripts/extract-config.sh`:
- Around line 146-171: Update the extract-mode validation in the END block so a
missing tab title reports an error and exits nonzero instead of silently
succeeding. Extend the existing found_tab/found_fence handling around
wanted_title, while preserving count mode and the current missing-fence and
missing-code-fence errors.

In `@scripts/test-config.sh`:
- Around line 119-128: Update the validation command in the
configuration-checking flow to capture its combined output during the initial
container run while preserving the exit status. In the failure branch, print the
captured output instead of invoking $CONTAINER_RUNTIME a second time; keep the
existing configuration and failure-context diagnostics unchanged.
- Around line 73-81: Update the image setup around CONTAINER_RUNTIME and
VALIDATION_IMAGE so the script checks whether VALIDATION_IMAGE is already
available locally before pulling it. Invoke the runtime’s image-inspection
command, pull only when the image is absent, and preserve the existing error
message and exit behavior when a required pull fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 526f19af-3dd1-4b14-80b6-0c240eb98fc1

📥 Commits

Reviewing files that changed from the base of the PR and between 4a310fb and 7e2c8c7.

📒 Files selected for processing (22)
  • .github/workflows/pr-example-validation.yaml
  • installation/downloads/docker.md
  • pipeline/buffering.md
  • pipeline/filters/geoip2-filter.md
  • pipeline/filters/kubernetes.md
  • pipeline/filters/parser.md
  • pipeline/inputs/blob.md
  • pipeline/inputs/cpu-metrics.md
  • pipeline/inputs/kafka.md
  • pipeline/inputs/tail.md
  • pipeline/outputs/dynatrace.md
  • pipeline/outputs/gelf.md
  • pipeline/outputs/kafka.md
  • pipeline/outputs/loki.md
  • pipeline/outputs/s3.md
  • pipeline/parsers.md
  • pipeline/processors/conditional-processing.md
  • pipeline/processors/sql.md
  • pipeline/router.md
  • scripts/README.md
  • scripts/extract-config.sh
  • scripts/test-config.sh
💤 Files with no reviewable changes (2)
  • pipeline/processors/conditional-processing.md
  • pipeline/outputs/gelf.md

Comment thread .github/workflows/pr-example-validation.yaml
Comment thread .github/workflows/pr-example-validation.yaml Outdated
Comment thread pipeline/filters/parser.md
Comment thread pipeline/inputs/kafka.md
Comment thread pipeline/parsers.md
Comment thread pipeline/router.md
Comment thread scripts/test-config.sh
Comment thread scripts/test-config.sh
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
patrick-stephens and others added 17 commits August 3, 2026 18:34
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
…in TOML format

Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Signed-off-by: Patrick Stephens <pat@telemetryforge.io>
Resolve all Vale errors and suggestions in the config example validation
PR, plus markdownlint errors in the new scripts README.

- scripts/README.md: replace "e.g.," with "for example," (3 instances),
  convert 5 headings to sentence case, use "aren't" contraction, and fix
  markdownlint MD031/MD032/MD040 by adding blank lines around fences and
  lists and switching nested Markdown examples to 4-backtick outer fences
- installation/downloads/docker.md: spell out "K8s" as "Kubernetes"
- pipeline/inputs/tail.md: use "`inode` numbers" so the term is in code
  font and skipped by the spelling rule
- pipeline/filters/parser.md: use "shouldn't" contraction
- pipeline/outputs/kafka.md: use "isn't" contraction
- pipeline/parsers.md: remove leading ellipsis and rewrite as a complete
  sentence

Signed-off-by: Eric D. Schabell <eric@schabell.org>
The example validation job added in this branch never validated
anything, and the script backing it could not run on macOS or report
extraction failures. Five defects, none of which surface as a red build.

Workflow (.github/workflows/pr-example-validation.yaml):

- Replace git diff-tree with git diff for the changed-file list.
  diff-tree does not honor the three-dot merge-base range and returned
  an empty list, and without -r it is not recursive so it would have
  listed top-level directories rather than file paths. Drop
  --no-commit-id, which is a diff-tree-only option. --name-only and
  --diff-filter=AMCR are unchanged.
- Match Markdown files on a literal .md suffix. The previous pattern
  './.*\.md$' left the dot unescaped, so it required every path to
  contain a directory separator and silently skipped Markdown files at
  the repository root.
- Write the file list to GITHUB_OUTPUT using the multiline delimiter
  syntax with a random delimiter. As a plain list=value entry the runner
  parsed only the first line and rejected the rest with "Invalid
  format" as soon as a PR touched more than one file. Quote
  GITHUB_OUTPUT while here.
- Update the comment that named git diff-tree.

Script (scripts/test-config.sh):

- Extract configurations into a per-run temporary directory and resolve
  its physical path before bind mounting. On macOS /tmp and $TMPDIR are
  symlinks into /private, which Docker Desktop file sharing cannot
  resolve, so it mounted an empty directory instead of the
  configuration and every example failed with a misleading "invalid
  YAML at line 1, column 1" error. The previous fixed filename also
  meant concurrent runs overwrote each other. Remove the directory on
  exit.
- Check the exit status of the Stage 1 example count instead of
  discarding it with "2>/dev/null || echo 0". A genuine extraction
  failure became a count of zero, so the file was skipped as having no
  examples and the run reported success. Failures now go through the
  existing FAILED_VALIDATIONS list with the underlying stderr replayed,
  while a real zero count remains a legitimate skip.

Signed-off-by: Eric D. Schabell <eric@schabell.org>
@eschabell
eschabell force-pushed the 2459_auto_validate_config_examples branch from 7e2c8c7 to 9fda3df Compare August 3, 2026 16:43
@eschabell

Copy link
Copy Markdown
Collaborator

@patrick-stephens fixed a bunch of things that came up on the review of the review. See what you think?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
pipeline/outputs/s3.md (4)

154-182: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Validate Parquet examples with an Arrow-enabled image or suppress them.

scripts/test-config.sh uses fluent/fluent-bit:latest by default, and the official Fluent Bit image does not include Apache Arrow/Parquet support. The discoverable fluent-bit.yaml and fluent-bit.conf examples with format: parquet can fail during fluent-bit --dry-run, so run them against an image with Parquet support, such as amazon/aws-for-fluent-bit, or add pipeline/outputs/s3.md to the validator suppression list with an explicit reason.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/outputs/s3.md` around lines 154 - 182, Update the Parquet examples
in the S3 output documentation so validation does not run them against the
default image lacking Arrow/Parquet support. Either configure their validation
to use an Arrow-enabled image such as amazon/aws-for-fluent-bit, or add
pipeline/outputs/s3.md to the validator suppression list with an explicit
reason, while preserving the examples themselves.

Source: Learnings


171-182: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Parquet PutObject examples need explicit total_file_size.

These examples rely on the 100M default: the YAML example at 171-182, plus the migratory YAML and classic config examples around 844-882. Add total_file_size: 50M or another valid PutObject value so the examples document a supported explicit size.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/outputs/s3.md` around lines 171 - 182, Add an explicit valid
total_file_size setting, such as 50M, to the Parquet PutObject examples in the
shown YAML configuration and the related migratory YAML and classic
configuration examples. Preserve the existing use_put_object settings and
formatting while ensuring each relevant example documents the size explicitly.

49-54: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Clarify Arrow output and unset compression behavior.

compression: arrow is legacy compatibility syntax, not a normal codec. Use format: arrow for Arrow/Feather output, with compression: zstd or unset for no Arrow compression. Add none/unset to the S3 compression table, and show Parquet files as uncompressed when format: parquet omits compression.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/outputs/s3.md` around lines 49 - 54, The S3 documentation must
clarify that Arrow output uses format: arrow, while compression: arrow is legacy
syntax; update the compression table in pipeline/outputs/s3.md lines 49-54 to
document none/unset, and revise pipeline/outputs/s3.md line 778 to show Parquet
files are uncompressed when format: parquet omits compression, with Arrow
compression using zstd or unset for no compression.

194-199: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Align the migration example with the documented PutObject requirement.

The Parquet section says format parquet requires use_put_object On, but lines 194-199 omit that setting. Add use_put_object: on or update this block to state that format parquet enables it automatically.

Proposed fix
 **After (recommended):**
 
 ```yaml
+use_put_object: on
 format: parquet
 compression: snappy
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/outputs/s3.md` around lines 194 - 199, Update the Parquet migration
YAML example to include the documented use_put_object: on setting alongside
format: parquet and compression: snappy, unless the surrounding documentation
explicitly establishes that Parquet enables it automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-example-validation.yaml:
- Around line 65-68: Update the changed-file iteration around CHANGED_MD_FILES
to read one line at a time, preserving each newline-delimited path as a single
argument to ./scripts/test-config.sh. Replace the unquoted for loop while
retaining the existing processing message and error_count increment behavior.
- Line 43: Update the changed-file collection around changed_md so git diff runs
separately and its failure causes the validation step to exit nonzero; only
after a successful diff should its output be filtered for .md files, preserving
the existing no-Markdown-files behavior for an empty result.

In `@scripts/README.md`:
- Around line 41-49: Update the all-files validation example to track whether
any invocation of test-config.sh fails, while continuing to process every
Markdown file; after the loop completes, exit with the tracked failure status so
automation receives a non-zero result when any file fails.

---

Outside diff comments:
In `@pipeline/outputs/s3.md`:
- Around line 154-182: Update the Parquet examples in the S3 output
documentation so validation does not run them against the default image lacking
Arrow/Parquet support. Either configure their validation to use an Arrow-enabled
image such as amazon/aws-for-fluent-bit, or add pipeline/outputs/s3.md to the
validator suppression list with an explicit reason, while preserving the
examples themselves.
- Around line 171-182: Add an explicit valid total_file_size setting, such as
50M, to the Parquet PutObject examples in the shown YAML configuration and the
related migratory YAML and classic configuration examples. Preserve the existing
use_put_object settings and formatting while ensuring each relevant example
documents the size explicitly.
- Around line 49-54: The S3 documentation must clarify that Arrow output uses
format: arrow, while compression: arrow is legacy syntax; update the compression
table in pipeline/outputs/s3.md lines 49-54 to document none/unset, and revise
pipeline/outputs/s3.md line 778 to show Parquet files are uncompressed when
format: parquet omits compression, with Arrow compression using zstd or unset
for no compression.
- Around line 194-199: Update the Parquet migration YAML example to include the
documented use_put_object: on setting alongside format: parquet and compression:
snappy, unless the surrounding documentation explicitly establishes that Parquet
enables it automatically.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0818df98-a13a-4d95-b0be-3d1bad914208

📥 Commits

Reviewing files that changed from the base of the PR and between 7e2c8c7 and 9fda3df.

📒 Files selected for processing (22)
  • .github/workflows/pr-example-validation.yaml
  • installation/downloads/docker.md
  • pipeline/buffering.md
  • pipeline/filters/geoip2-filter.md
  • pipeline/filters/kubernetes.md
  • pipeline/filters/parser.md
  • pipeline/inputs/blob.md
  • pipeline/inputs/cpu-metrics.md
  • pipeline/inputs/kafka.md
  • pipeline/inputs/tail.md
  • pipeline/outputs/dynatrace.md
  • pipeline/outputs/gelf.md
  • pipeline/outputs/kafka.md
  • pipeline/outputs/loki.md
  • pipeline/outputs/s3.md
  • pipeline/parsers.md
  • pipeline/processors/conditional-processing.md
  • pipeline/processors/sql.md
  • pipeline/router.md
  • scripts/README.md
  • scripts/extract-config.sh
  • scripts/test-config.sh
💤 Files with no reviewable changes (2)
  • pipeline/outputs/gelf.md
  • pipeline/processors/conditional-processing.md
🚧 Files skipped from review as they are similar to previous changes (17)
  • pipeline/filters/kubernetes.md
  • installation/downloads/docker.md
  • pipeline/inputs/blob.md
  • pipeline/processors/sql.md
  • pipeline/filters/geoip2-filter.md
  • pipeline/buffering.md
  • scripts/extract-config.sh
  • pipeline/outputs/loki.md
  • pipeline/inputs/cpu-metrics.md
  • pipeline/parsers.md
  • pipeline/filters/parser.md
  • pipeline/inputs/tail.md
  • pipeline/outputs/dynatrace.md
  • pipeline/inputs/kafka.md
  • pipeline/router.md
  • scripts/test-config.sh
  • pipeline/outputs/kafka.md

# We grep for *.md files you are interested in.
# The 'docs/' prefix is a common convention but adjust as necessary.
run: |
changed_md=$(git diff --name-only --diff-filter=AMCR ${{ github.event.pull_request.base.sha }}...HEAD | grep '\.md$' || true)

@coderabbitai coderabbitai Bot Aug 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Workflow snippets:"
if [ -f .github/workflows/pr-example-validation.yaml ]; then
  nl -ba .github/workflows/pr-example-validation.yaml | sed -n '1,140p'
else
  echo "workflow file missing"
fi

echo
echo "Changed diff command occurrences:"
rg -n "changed_md=\\$\\(git diff|\\|\\| true|changed_files" .github/workflows/pr-example-validation.yaml || true

echo
echo "Behavioral sim for grep failure modes:"
bash -c 'set -o pipefail; failed=0; changed_md=$(echo "README.md" | grep -x "not-there" || true); echo "grep_missing_changed_md=(empty)=[$changed_md]"'
bash -c 'set -o pipefail; changed_md=$(rm -f /tmp/nowhere-$$ && cat /tmp/nowhere-$$ 2>/dev/null | grep -x "README.md" || true); echo "grep_diff_failed_changed_md=(empty)=[$changed_md]"; exit_code=$?; echo "pipeline_exit=$exit_code" '
bash -c 'git diff --name-only --diff-filter=AMCR invalid-sha...HEAD; echo "diff_invalid_exit=$?"; true'

Repository: fluent/fluent-bit-docs

Length of output: 219


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Workflow snippets:"
if [ -f .github/workflows/pr-example-validation.yaml ]; then
  awk '{printf "%6d\t%s\n", NR, $0}' .github/workflows/pr-example-validation.yaml | sed -n '1,140p'
else
  echo "workflow file missing"
fi

echo
echo "Changed diff command occurrences:"
grep -n "changed_md=\$(git diff\|\\|\\| true\|changed_files" .github/workflows/pr-example-validation.yaml || true

echo
echo "Behavioral sim for grep failure modes:"
bash -c 'set -o pipefail; failed=0; changed_md=$(echo "README.md" | grep -x "not-there" || true); echo "grep_missing_changed_md=(empty)=[$changed_md]"'
bash -c 'set -o pipefail; changed_md=$(rm -f /tmp/nowhere-$$ && cat /tmp/nowhere-$$ 2>/dev/null | grep -x "README.md" || true); echo "grep_diff_failed_changed_md=$(cat)"
exit_code=${PIPESTATUS[@]:?}; echo "exit_code=$exit_code" '
bash -c 'set -o pipefail || true; git diff --name-only --diff-filter=AMCR invalid-sha...HEAD 2>/dev/null || echo "diff_invalid_exit_not_run"; true'

Repository: fluent/fluent-bit-docs

Length of output: 7182


🏁 Script executed:

#!/bin/bash
set -u

echo "Git availability:"
command -v git || true

echo
echo "Diff with invalid SHA and git status:"
(git diff --name-only --diff-filter=AMCR invalid-sha...HEAD 2>&1 || true)
echo "status=$?"

echo
echo "Diff with valid refs when git is available:"
if command -v git >/dev/null 2>&1; then
  git status --short --branch --porcelain
  changed_md=$(git diff --name-only --diff-filter=AMCR HEAD...HEAD 2>&1 || true)
  echo "exit=${PIPESTATUS[0]} changed_md=[$changed_md]"
fi

echo
echo "Bash pipefail/grep behavior:"
bash -c 'set -o pipefail; changed_md=$(printf "README.md\n" | grep -x "not-there" || true); echo "grep_missing_changed_md=[$changed_md]"'
bash -c 'set -e; changed_md=$(rm -f /tmp/nowhere-$$ && cat /tmp/nowhere-$$ 2>/dev/null | grep -x "README.md" || true); echo "should_not_print"; echo "changed_md=[$changed_md]"; false || true'
bash -c 'changed_md=$(rm -f /tmp/nowhere-$$ && cat /tmp/nowhere-$$ 2>/dev/null | grep -x "README.md" || true); echo "changed_md=[$changed_md]"; set -e; false'

Repository: fluent/fluent-bit-docs

Length of output: 626


Fail when git diff cannot compute the changed-file list.

changed_md=$(git diff ... | grep '\.md$' || true) makes the whole command succeed even if git diff encounters an invalid revision or repository error. CHANGED_MD_FILES stays empty, so the validation step prints “No Markdown files changed” and exits successfully.

Compute git diff separately, exit on failure, then filter the output for Markdown files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-example-validation.yaml at line 43, Update the
changed-file collection around changed_md so git diff runs separately and its
failure causes the validation step to exit nonzero; only after a successful diff
should its output be filtered for .md files, preserving the existing
no-Markdown-files behavior for an empty result.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to move this into the script itself so I can test it locally too I think rather than have to debug Github Actions...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrick-stephens, that approach is suitable. Keep the workflow limited to passing the PR base SHA and target SHA to the script.

In the script, run git diff before the Markdown filter. If git diff fails, return a nonzero status. Filter for .md files only after the diff succeeds. Preserve the empty-result behavior when no Markdown files changed.

You are interacting with an AI system.

Comment thread .github/workflows/pr-example-validation.yaml
Comment thread scripts/README.md
@patrick-stephens

Copy link
Copy Markdown
Contributor Author

@patrick-stephens fixed a bunch of things that came up on the review of the review. See what you think?

Cheers, yeah I've not run it on macOS and it's "special" shell so thanks for that. I'll re-run on Ubuntu to confirm all ok for CI and look to resolve that workflow issue which is outstanding. It may be we'll need to iterate a little after landing as testing workflows is unnecessarily difficult but using local scripts hopefully mitigates most of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-validate config examples

2 participants